<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>xilsecure: Xilsecure HMAC APIs</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">xilsecure
   </div>
   <div id="projectbrief">Vitis Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Overview</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="globals.html"><span>APIs</span></a></li>
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;"
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__xsecure__hmac__apis.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Xilsecure HMAC APIs</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ga8e3d7c4584d74d887627b067d18b6741"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xsecure__hmac__apis.html#ga8e3d7c4584d74d887627b067d18b6741">XSECURE_HMAC_8BIT_SHIFT</a>&#160;&#160;&#160;(8U)</td></tr>
<tr class="memdesc:ga8e3d7c4584d74d887627b067d18b6741"><td class="mdescLeft">&#160;</td><td class="mdescRight">8 Bit shift for HMAC  <a href="#ga8e3d7c4584d74d887627b067d18b6741">More...</a><br/></td></tr>
<tr class="separator:ga8e3d7c4584d74d887627b067d18b6741"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaea404628e0dc0b38de0148dc52efc332"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xsecure__hmac__apis.html#gaea404628e0dc0b38de0148dc52efc332">XSECURE_HMAC_16BIT_SHIFT</a>&#160;&#160;&#160;(16U)</td></tr>
<tr class="memdesc:gaea404628e0dc0b38de0148dc52efc332"><td class="mdescLeft">&#160;</td><td class="mdescRight">16 Bit shift for HMAC  <a href="#gaea404628e0dc0b38de0148dc52efc332">More...</a><br/></td></tr>
<tr class="separator:gaea404628e0dc0b38de0148dc52efc332"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4aa385971dc58a6bcfbc4cb2c070ce14"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xsecure__hmac__apis.html#ga4aa385971dc58a6bcfbc4cb2c070ce14">XSECURE_HMAC_24BIT_SHIFT</a>&#160;&#160;&#160;(24U)</td></tr>
<tr class="memdesc:ga4aa385971dc58a6bcfbc4cb2c070ce14"><td class="mdescLeft">&#160;</td><td class="mdescRight">24 Bit shift for HMAC  <a href="#ga4aa385971dc58a6bcfbc4cb2c070ce14">More...</a><br/></td></tr>
<tr class="separator:ga4aa385971dc58a6bcfbc4cb2c070ce14"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga733f0326ed9e68235daf7ecf8e2ef0cb"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xsecure__hmac__apis.html#ga733f0326ed9e68235daf7ecf8e2ef0cb">XSECURE_HMAC_WORD_LEN</a>&#160;&#160;&#160;(4U)</td></tr>
<tr class="memdesc:ga733f0326ed9e68235daf7ecf8e2ef0cb"><td class="mdescLeft">&#160;</td><td class="mdescRight">HMAC word length.  <a href="#ga733f0326ed9e68235daf7ecf8e2ef0cb">More...</a><br/></td></tr>
<tr class="separator:ga733f0326ed9e68235daf7ecf8e2ef0cb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga10fbad789f61dc129bbc3e64dbba56da"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xsecure__hmac__apis.html#ga10fbad789f61dc129bbc3e64dbba56da">XSECURE_HMAC_IPAD_VALUE</a>&#160;&#160;&#160;(0x36U)</td></tr>
<tr class="memdesc:ga10fbad789f61dc129bbc3e64dbba56da"><td class="mdescLeft">&#160;</td><td class="mdescRight">HMAC IPAD value.  <a href="#ga10fbad789f61dc129bbc3e64dbba56da">More...</a><br/></td></tr>
<tr class="separator:ga10fbad789f61dc129bbc3e64dbba56da"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa628ce44643bcd057dca75465ffc152d"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xsecure__hmac__apis.html#gaa628ce44643bcd057dca75465ffc152d">XSECURE_HMAC_OPAD_VALUE</a>&#160;&#160;&#160;(0x5CU)</td></tr>
<tr class="memdesc:gaa628ce44643bcd057dca75465ffc152d"><td class="mdescLeft">&#160;</td><td class="mdescRight">HMAC OPAD value.  <a href="#gaa628ce44643bcd057dca75465ffc152d">More...</a><br/></td></tr>
<tr class="separator:gaa628ce44643bcd057dca75465ffc152d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga326185e9709790ef9dc6d0eb61da6ab9"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xsecure__hmac__apis.html#ga326185e9709790ef9dc6d0eb61da6ab9">XSecure_HmacInit</a> (XSecure_Hmac *InstancePtr, XSecure_Sha3 *Sha3InstancePtr, u64 KeyAddr, u32 KeyLen)</td></tr>
<tr class="memdesc:ga326185e9709790ef9dc6d0eb61da6ab9"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function initializes the HMAC instance.  <a href="#ga326185e9709790ef9dc6d0eb61da6ab9">More...</a><br/></td></tr>
<tr class="separator:ga326185e9709790ef9dc6d0eb61da6ab9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaec1f83f5e69e2ba5d879cd97eab498eb"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xsecure__hmac__apis.html#gaec1f83f5e69e2ba5d879cd97eab498eb">XSecure_HmacUpdate</a> (XSecure_Hmac *InstancePtr, u64 DataAddr, u32 Len)</td></tr>
<tr class="memdesc:gaec1f83f5e69e2ba5d879cd97eab498eb"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function updates the data to be authenticated, which can be called repeatedly with chunks of the message to be authenticated (len bytes at data).  <a href="#gaec1f83f5e69e2ba5d879cd97eab498eb">More...</a><br/></td></tr>
<tr class="separator:gaec1f83f5e69e2ba5d879cd97eab498eb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga19b58a827d01b838233e4b98fb95b0f7"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xsecure__hmac__apis.html#ga19b58a827d01b838233e4b98fb95b0f7">XSecure_HmacFinal</a> (XSecure_Hmac *InstancePtr, XSecure_HmacRes *Hmac)</td></tr>
<tr class="memdesc:ga19b58a827d01b838233e4b98fb95b0f7"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function calculates the final HMAC.  <a href="#ga19b58a827d01b838233e4b98fb95b0f7">More...</a><br/></td></tr>
<tr class="separator:ga19b58a827d01b838233e4b98fb95b0f7"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="gaea404628e0dc0b38de0148dc52efc332"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define XSECURE_HMAC_16BIT_SHIFT&#160;&#160;&#160;(16U)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>16 Bit shift for HMAC </p>

</div>
</div>
<a class="anchor" id="ga4aa385971dc58a6bcfbc4cb2c070ce14"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define XSECURE_HMAC_24BIT_SHIFT&#160;&#160;&#160;(24U)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>24 Bit shift for HMAC </p>

</div>
</div>
<a class="anchor" id="ga8e3d7c4584d74d887627b067d18b6741"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define XSECURE_HMAC_8BIT_SHIFT&#160;&#160;&#160;(8U)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>8 Bit shift for HMAC </p>

</div>
</div>
<a class="anchor" id="ga10fbad789f61dc129bbc3e64dbba56da"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define XSECURE_HMAC_IPAD_VALUE&#160;&#160;&#160;(0x36U)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>HMAC IPAD value. </p>

<p>Referenced by <a class="el" href="group__xsecure__hmac__apis.html#ga326185e9709790ef9dc6d0eb61da6ab9">XSecure_HmacInit()</a>.</p>

</div>
</div>
<a class="anchor" id="gaa628ce44643bcd057dca75465ffc152d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define XSECURE_HMAC_OPAD_VALUE&#160;&#160;&#160;(0x5CU)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>HMAC OPAD value. </p>

<p>Referenced by <a class="el" href="group__xsecure__hmac__apis.html#ga326185e9709790ef9dc6d0eb61da6ab9">XSecure_HmacInit()</a>.</p>

</div>
</div>
<a class="anchor" id="ga733f0326ed9e68235daf7ecf8e2ef0cb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define XSECURE_HMAC_WORD_LEN&#160;&#160;&#160;(4U)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>HMAC word length. </p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ga19b58a827d01b838233e4b98fb95b0f7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XSecure_HmacFinal </td>
          <td>(</td>
          <td class="paramtype">XSecure_Hmac *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">XSecure_HmacRes *&#160;</td>
          <td class="paramname"><em>Hmac</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function calculates the final HMAC. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is the pointer to the XSecure_Hmac instance </td></tr>
    <tr><td class="paramname">Hmac</td><td>is the pointer of 48 bits which holds the resultant HMAC.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS If initialization was successful.</li>
<li>XSECURE_HMAC_INVALID_PARAM If any input parameter is invalid.</li>
<li>XST_FAILURE On failure.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>Though HMAC can be truncated, as the truncation of data may lead to security implications, this function always fills the HMAC pointer with 48 bytes of data. </dd></dl>

<p>References <a class="el" href="group__xsecure__error__codes.html#ggacba8dc046b878afa42fdc63ce1dc2574a6cbcb896914e6bfc67d9df759f6e111c">XSECURE_HMAC_INVALID_PARAM</a>, <a class="el" href="group__xsecure__generic__server__apis.html#ga7d9385d1d7121998a9be90e90d3a8f7b">XSecure_SetReset()</a>, <a class="el" href="group__xsecure__helper__server__apis.html#ga5cc13ecb6d06e87d8e2c4fec6ba9347d">XSECURE_SHA3_BLOCK_LEN</a>, and <a class="el" href="xsecure_8c.html#adfb02b0d0129acbfe8a8d6a293a7285f">XSecure_Sha3Hash()</a>.</p>

<p>Referenced by <a class="el" href="group__xsecure__kat__server__apis.html#gab8bb729a4444afbdef55ba93e2a06935">XSecure_HmacKat()</a>.</p>

</div>
</div>
<a class="anchor" id="ga326185e9709790ef9dc6d0eb61da6ab9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XSecure_HmacInit </td>
          <td>(</td>
          <td class="paramtype">XSecure_Hmac *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">XSecure_Sha3 *&#160;</td>
          <td class="paramname"><em>Sha3InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u64&#160;</td>
          <td class="paramname"><em>KeyAddr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>KeyLen</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function initializes the HMAC instance. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is the pointer to the XSecure_Hmac instance </td></tr>
    <tr><td class="paramname">Sha3InstancePtr</td><td>is the pointer to the XSecure_Sha3 instance. </td></tr>
    <tr><td class="paramname">KeyAddr</td><td>holds the address of HMAC key. </td></tr>
    <tr><td class="paramname">KeyLen</td><td>variable holds the length of the key.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS If initialization was successful.</li>
<li>XSECURE_HMAC_INVALID_PARAM If any input parameter is invalid.</li>
<li>XST_FAILURE On failure. </li>
</ul>
</dd></dl>

<p>References <a class="el" href="group__xsecure__error__codes.html#ggacba8dc046b878afa42fdc63ce1dc2574a6cbcb896914e6bfc67d9df759f6e111c">XSECURE_HMAC_INVALID_PARAM</a>, <a class="el" href="group__xsecure__hmac__apis.html#ga10fbad789f61dc129bbc3e64dbba56da">XSECURE_HMAC_IPAD_VALUE</a>, <a class="el" href="group__xsecure__hmac__apis.html#gaa628ce44643bcd057dca75465ffc152d">XSECURE_HMAC_OPAD_VALUE</a>, <a class="el" href="group__xsecure__generic__server__apis.html#ga7d9385d1d7121998a9be90e90d3a8f7b">XSecure_SetReset()</a>, and <a class="el" href="group__xsecure__helper__server__apis.html#ga5cc13ecb6d06e87d8e2c4fec6ba9347d">XSECURE_SHA3_BLOCK_LEN</a>.</p>

<p>Referenced by <a class="el" href="group__xsecure__kat__server__apis.html#gab8bb729a4444afbdef55ba93e2a06935">XSecure_HmacKat()</a>.</p>

</div>
</div>
<a class="anchor" id="gaec1f83f5e69e2ba5d879cd97eab498eb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XSecure_HmacUpdate </td>
          <td>(</td>
          <td class="paramtype">XSecure_Hmac *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u64&#160;</td>
          <td class="paramname"><em>DataAddr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>Len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function updates the data to be authenticated, which can be called repeatedly with chunks of the message to be authenticated (len bytes at data). </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is the pointer to the XSecure_Hmac instance </td></tr>
    <tr><td class="paramname">DataAddr</td><td>holds the address of data to be updated. </td></tr>
    <tr><td class="paramname">Len</td><td>variable holds the length of data.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS If initialization was successful.</li>
<li>XSECURE_HMAC_INVALID_PARAM If any input parameter is invalid.</li>
<li>XST_FAILURE On failure. </li>
</ul>
</dd></dl>

<p>References <a class="el" href="group__xsecure__error__codes.html#ggacba8dc046b878afa42fdc63ce1dc2574a6cbcb896914e6bfc67d9df759f6e111c">XSECURE_HMAC_INVALID_PARAM</a>, <a class="el" href="group__xsecure__generic__server__apis.html#ga7d9385d1d7121998a9be90e90d3a8f7b">XSecure_SetReset()</a>, and <a class="el" href="group__xsecure__helper__server__apis.html#ga5cc13ecb6d06e87d8e2c4fec6ba9347d">XSECURE_SHA3_BLOCK_LEN</a>.</p>

<p>Referenced by <a class="el" href="group__xsecure__kat__server__apis.html#gab8bb729a4444afbdef55ba93e2a06935">XSecure_HmacKat()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
	<p class="footer">&copy; Copyright 2015-2022 Xilinx, Inc. All Rights Reserved.</p>
	<p class="footer">&copy; Copyright 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.</p>
</div>
</body>
</html>
